package com.example.teamilkmall.service.Impl;

import com.example.teamilkmall.entity.ProductTypeInfo;
import com.example.teamilkmall.mapper.ProductTypeInfoMapper;
import com.example.teamilkmall.service.ProductTypeInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2025-01-07
 */
@Service
public class ProductTypeInfoServiceImpl implements ProductTypeInfoService {

    private final ProductTypeInfoMapper productTypeInfoMapper;

    public ProductTypeInfoServiceImpl(ProductTypeInfoMapper productTypeInfoMapper) {
        this.productTypeInfoMapper = productTypeInfoMapper;
    }

    @Override
    public List<ProductTypeInfo> getListProductTypeInfo() {
        return productTypeInfoMapper.getListProductTypeInfo();
    }

    @Override
    public PageInfo<ProductTypeInfo> listProductTypeInfo(Integer pageSize, Integer pageNum, String name) {
        return new PageInfo<>(productTypeInfoMapper.listProductTypeInfo(pageSize,pageNum,name));
    }

    @Override
    public void updateProductTypeInfo(ProductTypeInfo productTypeInfo) {
        productTypeInfoMapper.updateProductTypeInfo(productTypeInfo);
    }

    @Override
    public void deloneProductTypeInfo(Integer id) {
        productTypeInfoMapper.deloneProductTypeInfo(id);
    }

    @Override
    public void addProductTypeInfo(ProductTypeInfo productTypeInfo) {
        productTypeInfoMapper.addProductTypeInfo(productTypeInfo);
    }

}
